from django.conf.urls.defaults import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^scoreboard/', include('scoreboard.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    
    # Index
    (r'^/?$', 'scoreboard.boardv1.views.rings'),
    
    # Rings
    (r'^rings/?$', 'scoreboard.boardv1.views.rings'),
    (r'^ring/([0-9]+)/?$', 'scoreboard.boardv1.views.ring'),
    
    # Events
    (r'^events/?$', 'scoreboard.boardv1.views.events'),
    (r'^events/([0-9]{1,3})/?$', 'scoreboard.boardv1.views.events'),
    (r'^events/([0-9]+)/([A-Za-z])/?$', 'scoreboard.boardv1.views.events'),
    (r'^events/([0-9]+)/([A-Za-z])/([A-Za-z])/?$', 'scoreboard.boardv1.views.events'),
    (r'^event/([A-Za-z0-9]+)/?$', 'scoreboard.boardv1.views.event'),
    
    # Competitors
    (r'^competitors/?$', 'scoreboard.boardv1.views.competitors'),
    (r'^competitor/(.+)/(.+)/?$', 'scoreboard.boardv1.views.competitor'),
    
    # Setting desktop/mobile
    (r'^mobile/?$', 'scoreboard.boardv1.views.set_mobile'),
    (r'^desktop/?$', 'scoreboard.boardv1.views.set_desktop'),
    
    # Searching
    (r'^search/?$', 'scoreboard.boardv1.views.search'),
)

urlpatterns += staticfiles_urlpatterns()

